<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="lib/axios.js"></script>
  </head>
  <body>
    <button id="btn1">发起GET请求</button>
    <script>
      document.querySelector("#btn1").addEventListener("click", function () {
        let url = "http://www.liulongbin.top:3006/api/get";
        let obj = { name: "xz", age: 18 };
        // 参数1: url   参数2: 参数对象,{params:{name:'ss',age:18}}
        axios.get(url, { params: obj }).then(function (res) {
          console.log(res);
        });
      });
    </script>
  </body>
</html>
